package com.srwl.mytx.domain;

import com.srwl.mytx.domain.Contact;

import java.util.ArrayList;
import java.util.List;

public class ContactItem {
    public static final int CONTACT_ITEM_TYPE_PARENT = 0;
    public static final int CONTACT_ITEM_TYPE_CHILD = 1;
    public static final int CONTACT_ITEM_NO_DATA = 2;
    private int itemType;
    private String groupName;
    private Contact contact;
    private List<ContactItem> childContactList = new ArrayList<>();
    private ContactItem parentContact;
    private boolean displayChildContact;

    public ContactItem(int itemType) {
        this.itemType = itemType;
    }

    public ContactItem(int itemType, String groupName) {
        this.itemType = itemType;
        this.groupName = groupName;
    }

    public ContactItem(int itemType, Contact contact) {
        this.itemType = itemType;
        this.contact = contact;
    }

    public String getGroupName() {
        return groupName;
    }

    public void setGroupName(String groupName) {
        this.groupName = groupName;
    }

    public int getItemType() {
        return itemType;
    }

    public void setItemType(int itemType) {
        this.itemType = itemType;
    }

    public Contact getContact() {
        return contact;
    }

    public void setContact(Contact contact) {
        this.contact = contact;
    }


    public List<ContactItem> getChildContactList() {
        if (childContactList==null){
            childContactList=new ArrayList<>();
        }
        return childContactList;
    }

    public void setChildContactList(List<ContactItem> childContactList) {
        this.childContactList = childContactList;
    }

    public ContactItem getParentContact() {
        return parentContact;
    }

    public void setParentContact(ContactItem parentContact) {
        this.parentContact = parentContact;
    }

    public boolean isDisplayChildContact() {
        return displayChildContact;
    }

    public void setDisplayChildContact(boolean displayChildContact) {
        this.displayChildContact = displayChildContact;
    }
}